package vn.smartoffice.promail.services;

import vn.smartoffice.mapper.IMapper;

public abstract class BaseService<E, M extends IMapper<E>> implements IService<E> {

	protected M mapper;

	public BaseService(M mapper) {
		this.mapper = mapper;
	}

	@Override
	public E findById(long id) {
		return mapper.findById(id);
	}

	@Override
	public void deleteById(long id) {
		mapper.deleteById(id);
	}

	@Override
	public void save(E entity) {
		mapper.save(entity);
	}

	@Override
	public void update(E entity) {
		mapper.update(entity);
	}

}
